package d13_math;

import java.io.IOException;

public class RuntimeTest {
    public static void main(String[] args) throws IOException {
        Runtime r = Runtime.getRuntime();//单例通过get方法拿到
//        r.exit(0);//退出虚拟机
        System.out.println(r.availableProcessors());//查看处理器数量
        System.out.println(r.totalMemory()/1024.0/1024.0+"MB");//查看虚拟机内存
        System.out.println(r.freeMemory()/1024.0/1024.0+"MB");//空闲内存
        System.out.println(r.exec("xxxx"));//启动exe程序 返回程序对象 并且销毁
    }
}
